package com.fh.service.ServiceCheck;

import com.fh.exception.ServiceException;
import com.fh.service.airsys.airlineemployee.AirlineEmployeeService;
import com.fh.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 用户信息校验
 * Created by tugou on 2017/9/24.
 */
@Component("infoCheck")
public class InfoCheck extends CheckHandler {

    @Autowired
    AirlineEmployeeService airlineEmployeeService;

    protected void handle(PageData data) throws ServiceException,Exception{
        Long count = airlineEmployeeService.countFindById(data);
        if(count == 0){
            throw new ServiceException(50001,"用户状态为不可用");
        }
    }
}
